"""userManager URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

# from django.urls import url
from django.urls import path, re_path
from django4Scenicspot import settings

# from app01.views import depart, user, pretty, admin, account,task
from django.views.static import serve
from web.views import account,admin,user,book,message,scenery,image
from web.views import test1
urlpatterns = [
    # 配置首页
    path(r'', user.index),
    #配置media
    # re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}, name='media'),
    re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}, name='media'),
    # 前台用户端
    path('index/', user.index),
    path('package/<int:nid>/details/', user.package_details),
    path('package/1/details1/', book.package_details),
    path('package/', user.package),
    path('about/', user.about),
    path('contact/', message.contact),
    path('mybookInfo/', user.mybookInfo),
    # path('mainindex/', views.mainindex),
    path('mainindex/main/', admin.main),
    path('mainuser/list/', admin.mainuser_list),
    path('mainuser/list/add/', admin.mainuser_listadd),
    path('mainuser/<int:nid>/list/edit/', admin.mainuser_listedit),
    path('mainuser/<int:nid>/list/delete/', admin.mainuser_listdelete),
    # 管理员链接
    path('mainadmin/list/', admin.mainadmin_list),
    path('mainadmin/list/add/', admin.mainadmin_listadd),
    path('mainadmin/<int:nid>/list/edit/', admin.mainadmin_listedit),
    path('mainadmin/<int:nid>/list/delete/', admin.mainadmin_listdelete),
    # 预约信息
    path('mainbook/list/', book.mainbook_list),
    # path('mainbook/<int:nid>/list/edit/', admin.mainadmin_listedit),
    path('mainbook/<int:nid>/list/delete/', book.mainbook_listdelete),
    # 景点信息
    path('mainscenery/list/', scenery.mainscenery_list),
    path('mainscenery/list/add/', scenery.mainscenery_listadd),
    path('mainscenery/<int:nid>/list/edit/', scenery.mainscenery_listedit),
    path('mainscenery/<int:nid>/list/delete/', scenery.mainscenery_listdelete),
    # 图片信息
    path('mainimage/list/', image.mainimage_list),
    path('mainimage/list/add/', image.mainimage_listadd),
    path('mainimage/<int:nid>/list/edit/', image.mainimage_listedit),
    path('mainimage/<int:nid>/list/delete/', image.mainimage_listdelete),
    # 留言
    path('mainmessage/list/', message.mainmessage_list),
    path('mainmessage/<int:nid>/list/edit/', message.mainmessage_listedit),
    path('mainmessage/<int:nid>/list/delete/', message.mainmessage_listdelete),

    # 登录注册
    path('user/login/', account.user_login),
    path('user/register/', account.user_register),
    path('user/logout/', account.user_logout),
    path('image/code/', account.image_code),
    path('admin/login/', admin.admin_login),
    path('admin/logout/', admin.admin_logout),
    path('adminimage/code/', admin.image_code),
    path('er/<int:nid>/show/', book.mk_qrcode),
]
